package com.zhanglu.fun.services.website.client;

import com.zhanglu.fun.services.website.bean.response.IsLogin;
import com.zhanglu.fun.services.website.bean.response.UserResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @description
 * @Auther zhanglu
 * @Date 2017/9/20 下午4:08
 */

@FeignClient("AUTHENTICATIONCENTER")
public interface AuthenticationClient {
    @GetMapping("/fun/login")
    UserResponse login(@RequestParam("username") String username, @RequestParam("password") String password);

    @GetMapping("/fun/login/token")
    IsLogin isLogin(@RequestParam("token") String token);

    @GetMapping("/application/roles/{token}")
    List<String> getApplicationRolesByToken(@PathVariable("token") String token);
}
